//
//  ZYUserManager.m
//  ckjntiku
//
//  Created by Eileen Vivian on 2017/11/22.
//  Copyright © 2017年 Eileen Vivian. All rights reserved.
//

#import "ZYUserManager.h"

@implementation ZYUserManager
static ZYUserManager *userManager = nil;
+(ZYUserManager *)shareInstance
{
    if (userManager == nil) {
        userManager = [[ZYUserManager alloc]init];
    }
    return userManager;
}
-(void)setUserObject:(id)userObject forkey:(NSString *)key
{
    NSUserDefaults *userDefaults =[NSUserDefaults standardUserDefaults];
    if ([userObject isKindOfClass:[NSNull class]]) {
        return;
    }
    [userDefaults setObject:userObject forKey:key];
    [userDefaults synchronize];
}
-(id)getUserObjectForkey:(NSString *)key
{
    NSUserDefaults *userDefaults =[NSUserDefaults standardUserDefaults];
    NSString * object = [userDefaults objectForKey:key];
    [userDefaults synchronize];
    return object;
}
@end
